﻿CREATE FUNCTION dbo.GetDaysInYear(@year int)

RETURNS int
AS
BEGIN

	declare @numDays int;
	set @numDays = 365;
	
	
	if @year % 400 = 0
	begin
		set @numDays = 366;
	end
	
	RETURN @numDays

END